home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: 14 January 1999
- // Author: sw
- //
- //
- // Procedure Name:
- // birail1ToolScript
- //
- // Input Arguments:
- // what is going to happen when this script is called
- // $setToTool = 0 ==> do the command
- // $setToTool = 1 ==> show option box
- // $setToTool = 2 ==> return the command
- // $setToTool = 3 ==> show tool option box
- // $setToTool = 4 ==> enter the tool
- //
- // Return Value:
- // None.
- //
-
- global proc birailToolSetup( int $forceFactorySettings, string $goToTool )
- {
- if( $forceFactorySettings || !`optionVar -ex birailEuc` ) {
- optionVar -iv birailEuc 1;
- }
- if( $forceFactorySettings || !`optionVar -ex birailLac` ) {
- optionVar -iv birailLac 1;
- }
- if( "" != $goToTool ) {
- scriptCtx -e -euc `optionVar -q birailEuc` $goToTool;
- scriptCtx -e -lac `optionVar -q birailLac` $goToTool;
- }
- }
-
- proc createBirailContext( int $whichOne, string $tool )
- {
- birailToolSetup( 0, "" );
- switch ($whichOne) {
- case 1:
- if( ! `scriptCtx -exists $tool` ) {
- scriptCtx
- -i1 "birail1Gen.xpm"
- -bcn "birail1"
-
- -title "Birail 1 Tool"
- -toolCursorType "edit"
- -totalSelectionSets 2
- -cumulativeLists true
- -expandSelectionList true
- -exitUponCompletion `optionVar -q birailEuc`
- -fcs ("performBirail 0 1 \`currentCtx\`")
-
- -setNoSelectionPrompt "Select the profile curve."
- -setSelectionPrompt ("Profile curve selected. " +
- "Press ENTER to start rail selection.")
- -setDoneSelectionPrompt ("Profile curve selected. " +
- "Press ENTER to start rail selection.")
-
- -setAutoToggleSelection true
- -setAutoComplete true
- -setSelectionCount 1
- -nurbsCurve true
- -isoparm true
- -curveOnSurface true
- -surfaceEdge true
- -polymeshEdge true
-
- -setNoSelectionPrompt ("Profile curve selected. Select " +
- "two rails curves.")
- -setSelectionPrompt "Select the second rail curve."
- -setDoneSelectionPrompt ("Profile and rail curves selected. " +
- "Press ENTER to compute birail.")
- -setAutoToggleSelection true
- -setAutoComplete `optionVar -q birailLac`
- -setSelectionCount 2
- -nurbsCurve true
- -isoparm true
- -curveOnSurface true
- -surfaceEdge true
- -polymeshEdge true
-
- $tool;
- }
- break;
- case 2:
- if( ! `scriptCtx -exists $tool` ) {
- scriptCtx
- -i1 "birail2Gen.xpm"
- -bcn "birail2"
-
- -title "Birail 2 Tool"
- -toolCursorType "edit"
- -totalSelectionSets 2
- -cumulativeLists true
- -expandSelectionList true
- -exitUponCompletion `optionVar -q birailEuc`
- -fcs ("performBirail 0 2 \`currentCtx\`")
-
- -setNoSelectionPrompt "Select two profile curves."
- -setSelectionPrompt "Select the second profile curve."
- -setDoneSelectionPrompt ("Two profile curves selected. " +
- "Press ENTER to start rail selection.")
- -setAutoToggleSelection true
- -setAutoComplete true
- -setSelectionCount 2
- -nurbsCurve true
- -isoparm true
- -curveOnSurface true
- -surfaceEdge true
- -polymeshEdge true
-
- -setNoSelectionPrompt "Select two rail curves."
- -setSelectionPrompt "Select the second rail curve."
- -setDoneSelectionPrompt ("Profile and rail curves selected. " +
- "Press ENTER to compute birail.")
- -setAutoToggleSelection true
- -setAutoComplete `optionVar -q birailLac`
- -setSelectionCount 2
- -nurbsCurve true
- -isoparm true
- -curveOnSurface true
- -surfaceEdge true
- -polymeshEdge true
-
- $tool;
- }
- break;
- case 3:
- default:
- if( ! `scriptCtx -exists $tool` ) {
- scriptCtx
- -i1 "birail3Gen.xpm"
- -bcn "birail3"
-
- -title "Birail 3+ Tool"
- -toolCursorType "edit"
- -totalSelectionSets 2
- -cumulativeLists true
- -expandSelectionList true
- -exitUponCompletion `optionVar -q birailEuc`
- -fcs ("performBirail 0 3 \`currentCtx`")
-
- -setNoSelectionPrompt "Select any number of profile curves."
- -setSelectionPrompt ("Select additional profiles or press " +
- "ENTER to start rail curves selection.")
- -setDoneSelectionPrompt ("Select additional profiles or press " +
- "ENTER to start rail curves selection.")
-
- -setAutoToggleSelection true
- -setAutoComplete false
- -setSelectionCount 0
- -nurbsCurve true
- -isoparm true
- -curveOnSurface true
- -surfaceEdge true
- -polymeshEdge true
-
- -setNoSelectionPrompt "Select two rail curves."
- -setSelectionPrompt "Select the second rail curve."
- -setDoneSelectionPrompt ("Profile and rail curves selected. " +
- "Press ENTER to compute birail.")
- -setAutoToggleSelection true
- -setAutoComplete `optionVar -q birailLac`
- -setSelectionCount 2
- -nurbsCurve true
- -isoparm true
- -curveOnSurface true
- -surfaceEdge true
- -polymeshEdge true
-
- $tool;
- }
- break;
- }
- }
-
- global proc string birailToolScript( int $setToTool, int $whichOne )
- //
- // Description :
- // $setToTool = 0 ==> do the command
- // $setToTool = 1 ==> show option box
- // $setToTool = 2 ==> return the command
- // $setToTool = 3 ==> show tool option box
- // $setToTool = 4 ==> enter the tool
- {
- string $tool = "";
- if( $setToTool > 2 ) {
- switch( $whichOne ) {
- case 1:
- $tool = "birailOneProfileContext";
- break;
- case 2:
- $tool = "birailTwoProfileContext";
- break;
- case 3:
- default:
- $tool = "birailThreePlusProfileContext";
- break;
- }
- createBirailContext( $whichOne, $tool );
- }
-
- string $result = "";
- switch ($setToTool) {
- case 4:
- setToolTo $tool;
- break;
- default:
- $result = eval( "performBirail " + $setToTool + " " +
- $whichOne + " \"" + $tool + "\"" );
- break;
- }
- return $result;
- }
-